<?
	function writeErrorPage($msg){
		include "../../commons/templates/layout_o.inc" ;
		include "../../commons/templates/header.inc" ;
		echo "
			<div class='error'>
				<h1>
					<input type='button' class='button' onclick='window.close()' value='Close' style='margin:0;padding:0px;border:0px;color:yellow;float:right;font-weight:bold;'> 
					Error
				</h1>
				<div style='margin:10px'>
					$msg
				</div>
				
			</div>
		";
		include "../templates/layout_c.inc" ;
	}
	
	function writeInfoPage($msg){
		include "../../commons/templates/layout_o.inc" ;
		include "../../commons/templates/header.inc" ;
		
		writeInfoBox($msg);
		
		include "../templates/layout_c.inc" ;
	}
	
	function writeInfoBox($msg){
		
		echo "
			<div class='error'>
				<h1 style='background-color:darkblue'>
					<input type='button' class='button' onclick='window.close()' value='Close' style='margin:0;padding:0px;border:0px;color:yellow;float:right;font-weight:bold;'> 
					Info
				</h1>
				<div style='margin:10px'>
					$msg
				</div>
				
			</div>
		";
		
	}
	
	function writeJsWindowClose(){
		echo "<script>window.close();</script>";
	}
	
	function writeJsWindowCloseAndRefreshAfterSave(){
		echo " 
			<script>
				try{opener.opener.location = opener.opener.location; }catch(e){}
				try{opener.close(); }catch(e){}
				try{window.close();}catch(e){}
			</script>";
	}
	
?>